import fly from '../utils/fly.js'
/**
 * 获取结算参数
 */
export function getCheckoutParams() {
	return fly.request({
		url:'/trade/checkout-params',
		needToken: true,
		method:"GET"
	})
}
/**
 * 获取结算参数
 */
export function getCheckoutChecked(params) {
	return fly.request({
		url:'/trade/carts/checked',
		needToken: true,
		method:"GET",
		params
	})
}
/**
 * 设置收货地址id
 */
export function setCheckoutAddr(address_id) {
	return fly.request({
		url:'/trade/checkout-params/address-id/'+address_id,
		needToken: true,
		method:"POST"
	})
}
/**
 * 设置送货时间
 */
export function setReceiveTime(params) {
	return fly.request({
		url:'/trade/checkout-params/receive-time',
		needToken: true,
		method:"POST",
		params
	})
}
/**
 * 设置支付类型
 */
export function setPaymentType(params) {
	return fly.request({
		url:'/trade/checkout-params/payment-type',
		needToken: true,
		method:"POST",
		params
	})
}
/**
 * 设置发票信息
 */
export function setReceipt(params) {
	return fly.request({
		url:'/trade/checkout-params/receipt',
		needToken: true,
		method:"POST",
		params
	})
}
/**
 * 设置发票信息
 */
export function cancelReceipt(address_id) {
	return fly.request({
		url:'/trade/checkout-params/receipt',
		needToken: true,
		method:"DELETE"
	})
}
/**
 * 设置订单备注
 */
export function setCheckoutRemark(address_id) {
	return fly.request({
		url:'/trade/checkout-params/remark',
		needToken: true,
		method:"POST"
	})
}
